package com.nuoniu.sibanyun.entity.production;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.nuoniu.sibanyun.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 生产制造——派工单
 * </p>
 *
 * @author 小啊刚
 * @since 2021-04-19
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ma_dispatch_list")
@ApiModel(value="VProductionDispatchMain对象", description="生产制造——派工单")
public class VProductionDispatchMain extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "公司id")
    @TableField("company_id")
    private Integer companyId;

    @ApiModelProperty(value = "账套id")
    @TableField("account_id")
    private Integer accountId;

    @ApiModelProperty(value = "单据编号")
    @TableField("voucher_code")
    private String voucherCode;

    @ApiModelProperty(value = "单据日期")
    @TableField("voucher_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate voucherDate;

    @ApiModelProperty(value = "单据状态(0：未审核 1：已审核 9：中止 10：完工    )")
    @TableField("voucher_state")
    private Integer voucherState;

    @ApiModelProperty(value = "生产车间")
    @TableField("office_id")
    private Integer officeId;

    @ApiModelProperty(value = "生产车间名称")
    @TableField("office_name")
    private String officeName;

    @ApiModelProperty(value = "加工单ID")
    @TableField("production_work_main_id")
    private Integer productionWorkMainId;

    @ApiModelProperty(value = "加工单号")
    @TableField("production_work_code")
    private String productionWorkCode;

    @ApiModelProperty(value = "加工单-明细ID")
    @TableField("production_work_detail_id")
    private Integer productionWorkDetailId;


    @ApiModelProperty(value = "销售订单ID")
    @TableField("sale_order_id")
    private Integer saleOrderId;

    @ApiModelProperty(value = "销售单号")
    @TableField("sale_order_code")
    private String saleOrderCode;

    @ApiModelProperty(value = "工艺路线id")
    @TableField("process_route_id")
    private Integer processRouteId;

    @ApiModelProperty(value = "工艺路线名称")
    @TableField("process_route_name")
    private String processRouteName;

    @ApiModelProperty(value = "物料id（产品ID）")
    @TableField("inventory_id")
    private Integer inventoryId;

    @ApiModelProperty(value = "物料名称（产品名称）")
    @TableField("inventory_name")
    private String inventoryName;

    @ApiModelProperty(value = "物料主计量ID")
    @TableField("base_unit")
    private Integer baseUnit;

    @ApiModelProperty(value = "物料主计量名称")
    @TableField("base_unit_name")
    private String baseUnitName;

    @ApiModelProperty(value = "物料编码（产品编码）")
    @TableField("inventory_code")
    private String inventoryCode;

    @ApiModelProperty(value = "规格型号")
    @TableField("inventory_specification")
    private String inventorySpecification;

    @ApiModelProperty(value = "条形码")
    @TableField("inventory_bar_code")
    private String inventoryBarCode;

    @ApiModelProperty(value = "二维码（图片地址）")
    @TableField("inventory_qr_code")
    private String inventoryQrCode;

    @ApiModelProperty(value = "物料清单ID")
    @TableField("bom_id")
    private Integer bomId;

    @ApiModelProperty(value = "物料清单版本号")
    @TableField("bom_name")
    private String bomName;

    @ApiModelProperty(value = "总下达量")
    @TableField("total_inventory_quantity")
    private BigDecimal totalInventoryQuantity;

    @ApiModelProperty(value = "本次派遣数量（本次下达量）")
    @TableField("dispatch_inventory_quantity")
    private BigDecimal dispatchInventoryQuantity;

    @ApiModelProperty(value = "本次完成数量（已完成数量）")
//    @TableField("finish_inventory_quantity")
    private BigDecimal finishInventoryQuantity;

    @ApiModelProperty(value = "派遣次数(本次下达次数)")
    @TableField("dispatch_times")
    private Integer dispatchTimes;

    @ApiModelProperty(value = "派工日期")
    @TableField("dispatch_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate dispatchDate;

    @ApiModelProperty(value = "预计完工日期")
    @TableField("expect_finish_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate expectFinishDate;

    @ApiModelProperty(value = "负责人ID")
    @TableField("charge_user_id")
    private Integer chargeUserId;

    @ApiModelProperty(value = "负责人姓名")
    @TableField("charge_user_name")
    private String chargeUserName;

    @ApiModelProperty(value = "备注")
    @TableField("remarks")
    private String remarks;

    @ApiModelProperty(value = "审核人")
    @TableField("reviewer_user_id")
    private Integer reviewerUserId;

    @ApiModelProperty(value = "审核人姓名")
    @TableField("reviewer_user_name")
    private String reviewerUserName;

    @ApiModelProperty(value = "审核人日期")
    @TableField("reviewer_date")
    private LocalDateTime reviewerDate;

    @ApiModelProperty(value = "创建人")
    @TableField("create_user_id")
    private Integer createUserId;

    @ApiModelProperty(value = "创建人名称")
    @TableField("create_user_name")
    private String createUserName;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_date")
    private LocalDateTime createDate;

    @ApiModelProperty(value = "累计领用数量")
//    @TableField("cum_pick_quantity")
    private BigDecimal cumPickQuantity;


    @ApiModelProperty(value = "工序明细")
    @TableField(exist = false)
    private List<VProductionWorkProcedureDetail> procedureDetails;

}
